<?
    class AddrString extends HTMLControl {        
        function __construct($d,$multiline = false) {
            parent::__construct("div");
            
            // build the string
            $address = $d['address_line1'];
            $address .= ($d['address_line2'] ? ($multiline ? "<br>" : ", ") . $d['address_line2'] : '');
            $address .= ($multiline ? "<br>" : ", ");
            $address .= $d['city'] . ", " . $d['state'];
            if ($d['zip']) $address .= " " . $d['zip'];
            
            $this->SetHTML($address);
        }
    }
?>